import Base from './Base';
import { BaseProps } from '../interface';

interface DrawImageProps {
  baseProps: BaseProps;
  img: HTMLImageElement;
}

export default class Img extends Base {
  img: HTMLImageElement;

  constructor(props: DrawImageProps) {
    super(props.baseProps);
    this.img = props.img;
  }

  paint() {
    this.ctx.drawImage(this.img, this.x, this.y, this.width, this.height);
  }
}